package com.tanger.user;

import com.tanger.common.jpa.IDEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.io.Serializable;

/**
 * @Description 用户实体类
 * @Description indexes = @Index(columnList = "mobile"):普通索引；
 * @Description uniqueConstraints = @UniqueConstraint(columnNames= {"mobile"})：单列唯一索引
 * @Author Hchenbin
 * @Date 2022/10/09 16:28
 * @Version 1.0
 */
@Data
@Entity
@Api(value = "UserEntity", tags= "账户实体类")
@Table(name = "base_user",uniqueConstraints = @UniqueConstraint(columnNames= {"mobile"}))
public class UserEntity extends IDEntity implements Serializable {

	@Column(columnDefinition = "varchar(32) NOT NULL COMMENT '姓名'")
	@ApiModelProperty(value = "用户名")
	private String name;
	@Column(columnDefinition = "varchar(64) DEFAULT NULL COMMENT '密码加密id'")
	@ApiModelProperty(value = "用户密码")
	private String password;
	@Column(columnDefinition = "varchar(64) NOT NULL COMMENT '铭文密码'")
	@ApiModelProperty(value = "明文密码")
    private String expPassword;
	@Column(columnDefinition = "varchar(20) NOT NULL COMMENT '手机号'")
	@ApiModelProperty(value = "用户手机")
	private String mobile;
	@Column(columnDefinition = "varchar(50) DEFAULT NULL COMMENT '所属部门'")
	@ApiModelProperty(value = "所属部门")
	private String department;
	@Column(columnDefinition = "varchar(50) NOT NULL COMMENT '角色名'")
	@ApiModelProperty(value = "角色名称")
	private String roleName;
	@Column(columnDefinition = "int(1) NOT NULL COMMENT '账号状态'")
	@ApiModelProperty(value = "状态(1.启用 0.禁用)")
	private Integer status;
	@Column(columnDefinition = "int(1) NOT NULL COMMENT '是否删除'")
	@ApiModelProperty(value = "是否删除(0.否 1.是)")
	private Integer delFlag;
	@Column(columnDefinition = "int(1) NOT NULL COMMENT '是否超管(1.是 0.否)'")
	@ApiModelProperty(value = "是否超管(0.否 1.是)")
	private Integer isAdmin;
	@Column(columnDefinition = "bigint(20) DEFAULT NULL COMMENT '审核人ID'")
	@ApiModelProperty(value = "审核人ID")
	private Long infoAuditor;

}
